package com.example.mobile2021606144ywr0427;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private RecyclerView rvMainTitle;
    private List<Stop>list=new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initData();
        rvMainTitle.setLayoutManager(new LinearLayoutManager(this));
        rvMainTitle.setAdapter(new StopRVAdapter(list));
    }

    private void initData() {
        list.add(new Stop("国际大厦停车场","空位：30","距离：20公里","价格：5元/小时","地址：佛山市高明区富湾镇学府路8号"));
        list.add(new Stop("国际大厦停车场","空位：30","距离：20公里","价格：5元/小时","地址：佛山市高明区富湾镇学府路8号"));
        list.add(new Stop("国际大厦停车场","空位：30","距离：20公里","价格：5元/小时","地址：佛山市高明区富湾镇学府路8号"));
        list.add(new Stop("国际大厦停车场","空位：30","距离：20公里","价格：5元/小时","地址：佛山市高明区富湾镇学府路8号"));
        list.add(new Stop("国际大厦停车场","空位：30","距离：20公里","价格：5元/小时","地址：佛山市高明区富湾镇学府路8号"));
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tv_main_title);
        rvMainTitle = (RecyclerView) findViewById(R.id.rv_main_title);
    }
}